//
//  BannerContentView.swift
//  LeGou
//
//  Created by lxm on 2022/7/27.
//

import UIKit

class BannerContentView: ZMXIBView {

    //MARK: --------------------属性--------------------
    
    var estimateHeight : CGFloat {
        get {
            let h = (SCREEN_W - 24) / 351 * 120 + 12
            return h
        }
    }
    
    //MARK: --------------------UI控件--------------------
    @IBOutlet weak var banner: SDCycleScrollView!
    //MARK: --------------------生命周期--------------------
    override init(frame: CGRect) {
        super.init(frame: frame)
        setUI()
        bindAction()
        addConstraints()
    }
    
    required init?(coder: NSCoder) {
        super.init(coder: coder)
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        setUI()
        bindAction()
        addConstraints()
    }

    //MARK: --------------------UI--------------------
    func setUI() {
//        banner.localizationImageNamesGroup = ["bannerImg"]
//        banner.imageURLStringsGroup = ["http://yinongzhenxuan.oss-cn-beijing.aliyuncs.com/img/8799405d8f024d289bfce6b8f6695d56.png"]
        banner.pageDotColor = UIColor.zm.RGBA(r: 255, g: 255, b: 255, a: 0.55)
        banner.bannerImageViewContentMode = .scaleAspectFill
        banner.autoScrollTimeInterval = 5
    }
    
    func addConstraints() {
        snp.makeConstraints { make in
            let bannerwidth = SCREEN_W - 24
            let bannerHeight = 120 / 351 * bannerwidth
            make.height.equalTo(12 + bannerHeight)
        }
    }
    
    //MARK: --------------------methods--------------------
    func bindAction() {
        
    }
    //MARK: --------------------delegate--------------------

}
